package org.dtrd.modules.evaluation.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.evaluation.entity.bean.nrs.NrsDetail;

import java.util.Date;


/**
 * <p>
 * 
 * </p>
 *
 * @author xiao
 * @since 2022-08-15
 */
@Getter
@Setter
@TableName("dtrd_ent_evaluation_rd_nrs")
public class DtrdEntEvaluationRdNrs {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    /**
     * 患者Id
     */
    @TableField("patient_id")
    private Integer patientId;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;

    /**
     * 疾病状态 1分-骨选1 ；2分-腹选2 ；3分-颅选3
     */
    @TableField("disease_status")
    private String diseaseStatus;

    /**
     * 营养状况指标 0分-正常选1 ；1分-3个月选2； 2分-2个月选3； 3分-1个月选4
     */
    @TableField("nutritional_status")
    private Integer nutritionalStatus;

    /**
     * 是否大于70岁  0分小于70选1； 1分大于等于70选2
     */
    @TableField("is_seventy")
    private Integer isSeventy;

    /**
     * 最终得分
     */
    @TableField("score")
    private Integer score;

    /**
     * 评估结果
     */
    @TableField("output")
    private String output;

    public DtrdEntEvaluationRdNrs init() {
        isDel = 0;
        createTime = new Date();
        return this;
    }

    public DtrdEntEvaluationRdNrs parseFromDto(NrsDetail dto) {
        dataId = dto.getDataId();
        patientId = dto.getPatientId();
        diseaseStatus = dto.getDiseaseStatus();
        nutritionalStatus = dto.getNutritionalStatus();
        isSeventy = dto.getIsSeventy();
        return this;
    }


}
